package com.wocharging.wxapp.config;

import com.wocharging.wxapp.filter.FilterInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {


    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new FilterInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/wxApp/**")
                .excludePathPatterns("/user/login", "/register", "/img/getIcon/**", "/res/**")
                .excludePathPatterns("/doc.html",
                        "/webjars/**",
                        "/favicon.ico",
                        "/swagger-resources",
                        "/v2/api-docs");
    }



}

